<!-- File: /app/View/Posts/index.ctp -->

<h1>Posts</h1>




<?php echo $this->Html->link(
    'Add Post',
    array('controller' => 'posts', 'action' => 'add')
); ?>

<table>
    <tr>
        <th>Id</th>
        <th>Title</th>
        <th>Created</th>
    </tr>

    <!-- Here is where we loop through our $posts array, printing out post info -->

    <?php foreach ($posts as $post): ?>
    <tr>
        <td><?php echo $post['Post']['id']; ?></td>
        <td>
            <?php echo $this->Html->link($post['Post']['title'],
array('controller' => 'posts', 'action' => 'view', $post['Post']['id'])); ?>
        </td>
        
        
        
        
        <td><?php echo $post['Post']['created']; ?></td>
   
    <td>
            <?php
                echo $this->Form->postLink(
                    'Delete',
                    array('action' => 'delete', $post['Post']['id']),
                    array('confirm' => 'Are you sure?')
                );
            ?>
        </td>
         </tr>
    <?php endforeach; ?>
    <?php unset($post); ?>
    <?php 
    if(isset($_REQUEST['name']) &&  isset($_REQUEST['drink'])   ){
    	$name =	$_REQUEST['name'];
    	$drink = $_REQUEST['drink'];
    	
    	
    	
    	
    }
    
    ?>
</table>